package cn.edu.abtu.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * (SysPermission)实体类
 *
 * @author makejava
 * @since 2022-11-16 11:48:23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class SysPermission {

    private static final long serialVersionUID = 1L;

    /*
    * 权限编号
    * */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    /*
    * 权限名称
    * */
    private String label;


    /*
    * 父权限ID
    * */
    private Long parentId;


    /*
    * 父权限名称
    * */
    private String parentName;


    /*
    * 授权标识符
    * */
    private String code;


    /*
    * 路由地址
    * */
    private String path;


    /*
    * 路由名称
    * */
    private String name;


    /*
    * 授权路径
    * */
    private String url;


    /*
    * 权限类型(0-目录 1-菜单 2-按钮)
    * */
    private Integer type;


    /*
    * 图标
    * */
    private String icon;


    /*
    * 创建时间
    * */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date createTime;


    /*
    * 修改时间
    * */
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;


    /*
    * 备注
    * */
    private String remark;


    /*
    * 排序
    * */
    private Integer orderNum;


    /*
    * 是否删除(0-未删除，1-已删除)
    * */
    private Integer isDelete;


    /*
    * 子菜单列表
    * */
    @JsonInclude(JsonInclude.Include.NON_NULL) //属性值为null不进行序列化
    @TableField(exist = false)
    private List<SysPermission> children = new ArrayList<>();


    /*
    * 用于前端判断时菜单、目录、按钮
    * */
    @TableField(exist = false)
    private String value;

    /*
    * 是否展开
    * */
    @TableField(exist = false)
    private Boolean open;
}
